package yunjiao.javatutorials.apache.kafka;

import lombok.extern.slf4j.Slf4j;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 *
 * 消息消费
 *
 * @author yangyunjiao
 */
@Component
@Slf4j
public class KafkaDemoConsumer {
    // 监听 demo-topic 主题
    @KafkaListener(topics = "demo-topic", groupId = "demo-consumer-group")
    public void consumeMessage(String message) {
        log.info(">>> 消费者接收消息：" + message);
        // 业务处理...
    }
}
